package com.zkjl.protect_business.entity;

import com.zkjl.protect_business.entity.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

import java.util.List;

@Data
@ApiModel(description = "业务实体")
@Document(indexName = "pb_business", shards = 1, replicas = 0)
public class Business extends BaseEntity {

    @Id
    @ApiModelProperty(notes = "id")
    private String id;

    @ApiModelProperty(notes = "名称")
    private String name;

    @ApiModelProperty(notes = "父级id")
    private String pid;

    @ApiModelProperty(notes = "父级名称")
    private String pname;

    @ApiModelProperty(notes = "路径")
    private String path;

    @ApiModelProperty(notes = "排序")
    private Integer sort;

    @ApiModelProperty(notes = "参与单位")
    private List<String> orgIds;

    @ApiModelProperty(notes = "是否可以存档")
    private Boolean isArchive = true;

    @ApiModelProperty(notes = "路由")
    private String routing = "business";

    @ApiModelProperty(notes = "是否隐藏")
    private Boolean invisible = false;

    @ApiModelProperty(notes = "单位字段名称")
    private String orgFieldName;

    @ApiModelProperty(notes = "身份证号字段名称")
    private String idCardFieldName;

    @ApiModelProperty(notes = "唯一标识 字段名称")
    private String uniqueFieldName;

    @ApiModelProperty(notes = "发生时间 字段")
    private String occurredTime;

    @ApiModelProperty(notes = "包含字段")
    private List<BusinessField> fields;

}
